//
//  Macros.h
//  NewNym
//
//  Created by Gideon on 16/2/15.
//  Copyright © 2016年 LiZhenning. All rights reserved.
//

#ifndef Macros_h
#define Macros_h

#define kScreenWidth        [UIScreen mainScreen].bounds.size.width
#define kScreenHeight       [UIScreen mainScreen].bounds.size.height

#define VIEW_WIDTH (self.view.frame.size.width)
#define VIEW_HEIGHT (self.view.frame.size.height)

#define HexRGBA(rgbValue, a)     [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:a]

#define RGBACOLOR(r,g,b,a) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:(a)]

// 判断是否是iPhone X
#define IS_IPHONE_X ( fabs( ( double )[ [ UIScreen mainScreen ] bounds ].size.height - ( double )812 ) < DBL_EPSILON )
// 状态栏高度
#define STATUS_BAR_HEIGHT (IS_IPHONE_X ? 44.f : 20.f)
// 导航栏高度
#define NAVIGATION_BAR_HEIGHT (IS_IPHONE_X ? 88.f : 64.f)
// tabBar高度
#define TAB_BAR_HEIGHT (IS_IPHONE_X ? (49.f+34.f) : 49.f)
// home indicator
#define HOME_INDICATOR_HEIGHT (IS_IPHONE_X ? 34.f : 0.f)

#define TabbarHeight  ([[UIApplication sharedApplication] statusBarFrame].size.height>20?83:49) // 适配iPhone x 底栏高度


//代码适配
#define kAutoScanleX [UIScreen mainScreen].bounds.size.width/375.0

#define kAutoScanleY [UIScreen mainScreen].bounds.size.height/667.0

#define IS_IPHONE_5 ( fabs( ( double )[ [ UIScreen mainScreen ] bounds ].size.height - ( double )568 ) < DBL_EPSILON )

#define IS_IPHONE_6 ( fabs( ( double )[ [ UIScreen mainScreen ] bounds ].size.height - ( double )667 ) < DBL_EPSILON )

#define IS_IPHONE_6_PLUS ( fabs( ( double )[ [ UIScreen mainScreen ] bounds ].size.height - ( double )736 ) < DBL_EPSILON )

#define ApplicationDelegate                 ((AppDelegate *)[[UIApplication sharedApplication] delegate])

#define WS(weakSelf)  __weak __typeof(&*self)weakSelf = self;

#define loginColor HexRGBA(0x10e190, 1)

#define SUCCESS @"请求成功"

#define REQUEST_SUCCESS   [msg isEqualToString:SUCCESS]

#define GAODE_MAP_APPKEY @"59c029f81891822c780cadf1734f49b1"

#define WeChat_ID @"wxc1b625d59e171cfe"
#define WeChat_AppSecret @"d07b3d562fb646b56e566ce38df0e739"


/**
 缓存token
 @return
 */
#define K_DEFATULS_TOKEN  @"K_DEFATULS_TOKEN"

#define USER_DIC  @"userDic"


/**
 刷新用户列表

 @return
 */
#define REFRESH_USER_INFO @"REFRESH_USER_INFO"


#endif /* Macros_h */
